import pygame
import Gun

class Fire(pygame.sprite.Sprite):

    def __init__(self,screen,gun):

        super(Fire,self).__init__()
        self.screen = screen
        self.rect = pygame.Rect(0,0,2,12)
        self.color = (166,230,29)
        self.speed = 2
        self.rect.centerx = gun.rect.centerx
        self.rect.top = gun.rect.top
        self.y = float(self.rect.y)

    def update(self):
        "bullet movement"
        self.y -= self.speed
        self.rect.y = self.y

    def drawBullet(self):
        "draw bullet"
        pygame.draw.rect(self.screen,self.color,self.rect)

